<?php
if( !defined('IN') ) die('Hacking Attempt');
/**
 * Description of Tools
 *
 * @author FFOZEU
 */

class Tools {

#################################################
# Affichage de la date de fin des enchères @int #
#################################################

    function afficherDate($time) {

        if( $time >= 86400 ) {

            $jour = floor($time/86400);
            $reste = $time%86400;

            $heure = floor($reste/3600);
            $reste = $reste%3600;

            $minute = floor($reste/60);

            $seconde = $reste%60;

            $sortie = $jour . 'j '.$heure . 'h ' . $minute . 'min ' . $seconde . 'sec';

        } elseif( $time < 86400 AND $time >= 3600 ) {

            $heure = floor($time/3600);
            $reste = $time%3600;

            $minute = floor($reste/60);

            $seconde = $reste%60;

            $sortie = $heure . 'h ' . $minute . 'min ' . $seconde . 'sec';

        } elseif( $time < 3600 AND $time >= 60 ) {

            $minute = floor($time/60);

            $seconde = $time%60;

            $sortie = $minute . 'min ' . $seconde . 's';

        } elseif( $time < 60 AND $time > 3 ) $sortie = $time . 's';
          elseif( $time == 3 ) $sortie = _UNE_FOIS_;
          elseif( $time == 2 ) $sortie = _DEUX_FOIS_;
          elseif( $time == 1 ) $sortie = _TROIS_FOIS_;

        return $sortie;

    }

######################
# Gestion du pluriel #
######################

    function pluriel($nbr) {

        if( $nbr > 1 ) return 's';

    }
	
}

?>
